Conversation
…atch for output helper handlers for multiple map types
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for userspace+kernelspace stack trace functionality by introducing ring buffer helpers and renaming the RingBuf class to RingBuffer. The changes also include refactoring map handling to use a MapSymbol dataclass and bumping the minimum Python version requirement.
Key changes:
- Renamed
RingBuftoRingBufferwith additional methods (output,discard) - Introduced
MapSymboldataclass to encapsulate map type and LLVM IR symbol - Added BPF helpers for ring buffer operations (
reserve,submit,output) and stack traces (get_stack)
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pythonbpf/maps/maps_utils.py | Adds MapSymbol dataclass to represent map symbols with type and IR variable |
| pythonbpf/maps/maps_pass.py | Updates map processors to use MapSymbol, renames RingBuf to RingBuffer, adds validation for ringbuf max_entries |
| pythonbpf/maps/maps.py | Renames RingBuf class to RingBuffer, adds output and discard methods, removes flags parameter from reserve |
| pythonbpf/maps/init.py | Updates exports to use RingBuffer instead of RingBuf and exports BPFMapType |
| pythonbpf/helper/helpers.py | Adds get_stack helper function |
| pythonbpf/helper/bpf_helper_handler.py | Adds BPF helper IDs for ringbuf and get_stack, implements emitters for ringbuf operations and get_stack, refactors output handler to route based on map type |
| pythonbpf/helper/init.py | Exports get_stack helper |
| pythonbpf/codegen.py | Reformats with-statement using parenthesized context managers (Python 3.10+ style) |
| pyproject.toml | Bumps minimum Python version from 3.8 to 3.10 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.